from typing import TYPE_CHECKING, Final

if TYPE_CHECKING:
    from server.apps.blog.models import BlogPost

#: We used to annotate titles of unfinished articles with `WIP` prefix.
_WIP_PREFIX: Final = 'WIP'


def is_ready_to_be_published(blogpost: 'BlogPost') -> bool:
    """Pure function that decides is this post is ready to be published."""
    # reveal_type(blogpost)
    # reveal_type(blogpost.body)
    # reveal_type(blogpost.objects)
    return blogpost.title.startswith(_WIP_PREFIX)
